//-----------------------------------------------------------------------
// <copyright file="a_UserService.cs" company="AACECOM">
//     Copyright (c) AACECOM. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections;
using ThoiTrang.Entities;
using ThoiTrang.Data;
    
namespace ThoiTrang.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class a_UserService
    {
        #region a_User

        public static void Createa_User(a_User a_User)
        {            
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                a_UserDAO.Createa_User(a_User);
            }            
            catch (Exception ex)
            {                
                throw ex;
            }
        }        

        public static void Updatea_User(a_User a_User)
        {            
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                a_UserDAO.Updatea_User(a_User);
            }           
            catch (Exception ex)
            {
                throw ex;
            }
        }        

        public static void Deletea_User(int userID)
        {            
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                a_UserDAO.Deletea_User(userID);
            }            
            catch (Exception ex)
            {
                throw ex;
            }
        }
        
        public static a_User Geta_User(int userID)
        {            
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_User(userID);                
            }            
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static a_User Geta_UserByEmail(string email)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserByEmail(email);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static a_User Geta_UserBySSID(string ssid)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserBySSID(ssid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static a_User Geta_UserByLoginEmail(string email)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserByLoginEmail(email);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_User Geta_User(string ckid)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserByCookieID(ckid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }    

        public static a_UserCollection Geta_UserList(a_UserColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserList(orderBy, orderDirection);
            }            
            catch (Exception ex)
            {
               throw ex;
            }
        }        

        public static a_UserCollection Geta_UserList(a_UserColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }            
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_UserCollection Geta_UserList_typeid(int typeid, a_UserColumns orderBy, OrderDirection orderDirection)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserList_typeid(typeid, orderBy, orderDirection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_UserCollection Geta_UserList_typeid(int typeid, a_UserColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserList_typeid(typeid, orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_UserCollection Geta_UserList_search(string usertype, bool st, string searchby, string searchtext, DateTime fDate, DateTime eDate, a_UserColumns orderBy, OrderDirection orderDirection)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserList_search(usertype, st, searchby,searchtext,fDate,eDate, orderBy, orderDirection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_UserCollection Geta_UserList_search(string usertype, bool st, string searchby, string searchtext, DateTime fDate, DateTime eDate, a_UserColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_UserList_search(usertype, st,searchby, searchtext, fDate, eDate, orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }        

        #endregion

        public static a_User Geta_UserBySessionId(string sessionId)
        {
            try
            {
                a_UserDAO a_UserDAO = new a_UserDAO();
                return a_UserDAO.Geta_User(sessionId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}